// 定义一个类
class Stu{
    code:string = "1000";
    name:string ="张三";

    // 构造函数
    constructor(name:string){
        this.name = name
    }

    // 定义方法
   private ask(){
        console.log(this.code,this.name)
    }
   ask2(){
        this.ask()
    }
}
// 类的调用
let s1 = new Stu("王小明");
s1.ask2();
s1.name;